import sun.security.rsa.RSASignature;

import java.util.Scanner;

/**
 * Created by Salted fish
 * Description:
 * User: 24539
 * Date：2021-07-31
 * Time: 12:12
 */
public class Test11 {
     public static int count=0;
    public static void main(String[] args) {
       //Scanner sn =new Scanner(System.in);
     //   int n = sn.nextInt();
        hanT(3,'x','y','z');
        System.out.println();
        System.out.println("移动了"+count);
    }
    public static void move(char a,char b) {
        System.out.println(a+"->"+b+" ");
    }
public static void hanT(int n,char a,char b,char c) {
    count++;
        if(n==1){
            move(a,c) ;
        }else  {
            hanT(n-1,a,c,b);
            move(a,c);
            hanT (n-1,b,a,c);
        }
}

}
